//
//  BKSCCommon.h
//  bestkeep
//
//  Created by 毛韶谦 on 2016/11/3.
//  Copyright © 2016年 utouu. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "BKSCBuyCarTool.h"
#import "Masonry.h"
#import "MJExtension.h"
#import <Realm.h>
#import "CacheImage.h"
#import <SDWebImage/UIImageView+WebCache.h>
#import "HUD.h"
#import "BKAnimatedAlert.h"
//----------------------ABOUT SYSTYM & VERSION 系统与版本 ----------------------------
//Get the OS version.       判断操作系统版本
#define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]

#define NOTICESEND_BACKTOFIRST @"NOTICESEND_BACKTOFIRST"

//动态获取设备高度
#define IPHONE_HEIGHT [UIScreen mainScreen].bounds.size.height

//动态获取设备宽度
#define IPHONE_WIDTH [UIScreen mainScreen].bounds.size.width

#define RGB(__r, __g, __b)  [UIColor colorWithRed:(1.0*(__r)/255)\
green:(1.0*(__g)/255)\
blue:(1.0*(__b)/255)\
alpha:1.0]
#define iPhone4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(320, 480), [[UIScreen mainScreen] currentMode].size) : NO) ?YES:NO
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)

#define iPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242,2208), [[UIScreen mainScreen] currentMode].size) : NO)


#define BKSCLocalizedString(key) [BKSCCommon localizedStringWithKey:key]

#define RGBCOLOR(R,G,B,A) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:A]
#define RgbColor(r, g, b)       [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]
#define BUYCARGRAYCOLOR [BKSCCommon fromHexValue:0xf2f2f2]
#define COLOR_01 [BKSCCommon fromHexValue:0xE5E5E5]
#define COLOR_02 [BKSCCommon fromHexValue:0x5f646e]
#define COLOR_03 [BKSCCommon fromHexValue:0xf0efef]
#define COLOR_04 [BKSCCommon fromHexValue:0x03bfa0]
#define COLOR_05 [BKSCCommon fromHexValue:0x999999] //中灰
#define COLOR_06 [BKSCCommon fromHexValue:0xFF6600] //橘黄色
#define COLOR_07 [BKSCCommon fromHexValue:0x5F646E] //深灰
#define COLOR_08 [BKSCCommon fromHexValue:0xf7f7f7] //浅灰
#define COLOR_09 [BKSCCommon fromHexValue:0x666666] //浅灰
#define COLOR_10 [BKSCCommon fromHexValue:0x333333] //黑色
#define COLOR_11 [BKSCCommon fromHexValue:0xc8c8c8] //黑色
//主题线条
#define COLOR_ORDER_DETAIL_Line RGB(218, 218, 218)
//首页，购物车，商品详情页 统一 红
#define BESTKEEP_RED RGB(255, 16, 16)

//判断环境  url
#define BKSCURL(url)            [BKSCCommon bkscServicesURL:url]
//空值判断
#define checkNull(__X__)        (__X__) == [NSNull null] || (__X__) == nil ? @"" : [NSString stringWithFormat:@"%@", (__X__)]
@interface BKSCCommon : NSObject

+(NSString*)localizedStringWithKey:(NSString*)key;

//修改商品  参数转换
+(NSString *)arrayToJson:(NSArray *)arr;
//结算前的校验
+ (NSString*)dictionaryToJson:(NSDictionary *)dic;
//
+ (NSString *)bkscServicesURL:(NSString *)url;
+ (UIColor *)fromHexValue:(NSUInteger)hex;

@end
